package day04;

import java.util.Random;
import java.util.Scanner;

public class Guessing {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("1~1000请猜一个数！");
        Random random = new Random();
        int num = random.nextInt(1000)+1;
        int guess = scanner.nextInt();
        while (num!=guess){
            if (guess<num){
                System.out.println("猜小了再猜！");
            }else {
                System.out.println("猜大了再猜！");
            }
            guess = scanner.nextInt();

        }
        System.out.println("恭喜猜对了！");





    }
}
